package com.ruoyi.news.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.news.domain.XcxNewComment;
import com.ruoyi.news.mapper.XcxNewCommentMapper;
import com.ruoyi.news.service.IXcxNewCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 资讯评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-02
 */
@Service
public class XcxNewCommentServiceImpl implements IXcxNewCommentService
{
    @Autowired
    private XcxNewCommentMapper xcxNewCommentMapper;

    /**
     * 查询资讯评论
     * 
     * @param id 资讯评论主键
     * @return 资讯评论
     */
    @Override
    public XcxNewComment selectXcxNewCommentById(String id)
    {
        return xcxNewCommentMapper.selectXcxNewCommentById(id);
    }

    /**
     * 查询资讯评论列表
     * 
     * @param xcxNewComment 资讯评论
     * @return 资讯评论
     */
    @Override
    public List<XcxNewComment> selectXcxNewCommentList(XcxNewComment xcxNewComment)
    {
        return xcxNewCommentMapper.selectXcxNewCommentList(xcxNewComment);
    }

    /**
     * 新增资讯评论
     * 
     * @param xcxNewComment 资讯评论
     * @return 结果
     */
    @Override
    public int insertXcxNewComment(XcxNewComment xcxNewComment)
    {
        xcxNewComment.setCreateTime(DateUtils.getNowDate());
        return xcxNewCommentMapper.insertXcxNewComment(xcxNewComment);
    }

    /**
     * 修改资讯评论
     * 
     * @param xcxNewComment 资讯评论
     * @return 结果
     */
    @Override
    public int updateXcxNewComment(XcxNewComment xcxNewComment)
    {
        xcxNewComment.setUpdateTime(DateUtils.getNowDate());
        return xcxNewCommentMapper.updateXcxNewComment(xcxNewComment);
    }

    /**
     * 批量删除资讯评论
     * 
     * @param ids 需要删除的资讯评论主键
     * @return 结果
     */
    @Override
    public int deleteXcxNewCommentByIds(String[] ids)
    {
        return xcxNewCommentMapper.deleteXcxNewCommentByIds(ids);
    }

    /**
     * 删除资讯评论信息
     * 
     * @param id 资讯评论主键
     * @return 结果
     */
    @Override
    public int deleteXcxNewCommentById(String id)
    {
        return xcxNewCommentMapper.deleteXcxNewCommentById(id);
    }
}
